/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package extras.modelo;

import java.util.LinkedList;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author Diego
 */
public abstract class tabelaModelo extends AbstractTableModel
{

    protected LinkedList<Object> valores = new LinkedList<>();
    protected LinkedList<String> Cabecalho = new LinkedList<>();

    public tabelaModelo()
    {
        super();
    }

    public tabelaModelo(LinkedList<Object> valores, LinkedList<String> Cabecalho)
    {
        super();
        this.valores = new LinkedList<>(valores);
        this.Cabecalho = Cabecalho;
    }

    @Override
    public int getRowCount()
    {
        return getValores().size();
    }

    @Override
    public String getColumnName(int column)
    {
        return getCabecalho().get(column);
    }

    @Override
    public Class getColumnClass(int columnIndex)
    {
        return String.class;
    }

    @Override
    public int getColumnCount()
    {
        return getCabecalho().size();
    }

    @Override
    public abstract Object getValueAt(int rowIndex, int columnIndex);

    /**
     * @return the valores
     */
    public LinkedList<Object> getValores()
    {
        return valores;
    }

    /**
     * @param valores the valores to set
     */
    public void setValores(LinkedList<Object> valores)
    {
        this.valores = valores;
    }

    /**
     * @return the Cabecalho
     */
    public LinkedList<String> getCabecalho()
    {
        return Cabecalho;
    }

    /**
     * @param Cabecalho the Cabecalho to set
     */
    public void setCabecalho(LinkedList<String> Cabecalho)
    {
        this.Cabecalho = Cabecalho;
    }
}
